package user;

import action.BaseAction;
import dao.Jdbcuserdao;
import dao.Userdao;
import entity.User;

public class WarAction extends BaseAction {
	private int id;
	private String acc;
	private boolean ok = false;

	public String execute() throws Exception {
		Userdao dao = new Jdbcuserdao();
		//获取session中的用户信息
		User user = (User)session.get("user");
		ok = dao.war(id, user);
		if (ok) {
			return "success";
		} else {
			return "fail";
		}
	}

	public String getAcc() {
		return acc;
	}

	public void setAcc(String acc) {
		this.acc = acc;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public boolean isOk() {
		return ok;
	}

	public void setOk(boolean ok) {
		this.ok = ok;
	}

}
